package com.Smart.smartscals.PopUpView;

import java.util.ArrayList;

import com.Smart.smartscals.Activity.BaseActivity;
import com.Smart.smartscals.Utils.Tools;


import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class PopUpViewMenu extends Activity implements OnClickListener {

	private View mView, baseView;
	private PopupWindow mPopupWindow;
	private Context mContext;
	private RelativeLayout mLayoutMenu, mLayoutBack, mLayoutDevice, mLayoutSet;
	private ArrayList<RelativeLayout> arrayListLayouts;
	private int menuType;

	public void popViewBottomParamSetView(View view, BaseActivity mActivity,
			int menuType) {

		Tools.setLog("--->popview--->1");
		this.mContext = mActivity.getBaseContext();
		this.baseView = view;
		this.menuType = menuType;
		initView();
		initParam();
		setListener();
		showPopUpView();
		setYellowBg();

	}

	/*
	 * ���û�ɫ����
	 */
	private void setYellowBg() {
		
		
	}

	/*
	 * ��ʾPopupView;
	 */
	private void showPopUpView() {

		mPopupWindow = new PopupWindow(mView);
		// ����;
//		mPopupWindow.setAnimationStyle(R.style.scale);
		// �߶ȱ���;
		mPopupWindow.setHeight(baseView.getHeight());
		mPopupWindow.setWidth(baseView.getWidth());
		// ������ʾλ��;

		//
		// mPopupWindow.showAtLocation(baseView, Gravity.NO_GRAVITY,
		// entityParamSetPopView.getLocationX(),
		// entityParamSetPopView.getLocationY());
		//
		// mPopupWindow.setFocusable(true);
		// mPopupWindow.setOutsideTouchable(true);

		mPopupWindow.showAsDropDown(baseView);
	}

	/*
	 * ���ò���ֵ
	 */
	private void initParam() {
		arrayListLayouts = new ArrayList<RelativeLayout>();
	

		arrayListLayouts.add(mLayoutMenu);
		arrayListLayouts.add(mLayoutBack);
		arrayListLayouts.add(mLayoutDevice);
		arrayListLayouts.add(mLayoutSet);

	}

	/**
	 * ���ü���;
	 */
	private void setListener() {
//		mView.findViewById(R.id.pop_meue_btn_realtimescan).setOnClickListener(
//				this);
//		mView.findViewById(R.id.pop_meue_btn_backsacn).setOnClickListener(this);
//		mView.findViewById(R.id.pop_meue_btn_device).setOnClickListener(this);
//		mView.findViewById(R.id.pop_meue_btn_set).setOnClickListener(this);
	}

	/**
	 * ��ʼ��View;
	 */
	private void initView() {
		
	}

	/**
	 * PopWindow��ʧ;
	 */
	public void dismiss() {
		mPopupWindow.dismiss();
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {
		
		default:
			break;
		}

	}

	private void statrMyActivity(int i) {
		
	}
}
